﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ReconSite.Master" AutoEventWireup="true"
    CodeBehind="UserMaster.aspx.cs" Inherits="ReconUI.UserMaster" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:Content ID="TitleContent" ContentPlaceHolderID="TitleHolder" runat="server">
</asp:Content>
<asp:Content ID="BodyContent" ContentPlaceHolderID="BodyHolder" runat="server">
     <div class="formDiv" style="width:65%">
    <h2 class="formTitle">User Master</h2>
    <h1 class="formError" style="text-align:right;font-size:smaller;color:#CC2900;">Fields marked with * are mandatory</h1>
	<%--<span id="mandatoryMessage" class="formError">Fields marked with * are mandatory</span>--%>
    <table cellspacing="1" cellpadding="1" border="0" width="100%">
        
        <tr>
            <td align="right">
                Option<span class="required">*</span>
            </td>
            <td colspan="3">
             <asp:RadioButtonList ID="rbOption" runat="server" RepeatDirection="Horizontal" 
                    RepeatLayout="Flow" AutoPostBack="True" 
                    onselectedindexchanged="rbOption_SelectedIndexChanged" TabIndex="1">
                    <asp:ListItem Value="1" Selected="True">Add</asp:ListItem>
                    <asp:ListItem Value="2">Modify</asp:ListItem>
                    </asp:RadioButtonList>
                <%--<asp:DropDownList ID="ddlOption" runat="server">
                    <asp:ListItem Value="0">Please Select</asp:ListItem>
                    <asp:ListItem Value="1">Add</asp:ListItem>
                    <asp:ListItem Value="2">Modify</asp:ListItem>
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="reqOption" runat="server" 
                    ErrorMessage="Mandatory" CssClass="formError"
                    ControlToValidate="ddlOption" InitialValue="0" 
                    SetFocusOnError="True"></asp:RequiredFieldValidator>--%>
            </td>
        </tr>
        <tr>
            <td align="right">
                User ID<span class="required">*</span>
            </td>
            <td colspan="3">
                <asp:TextBox ID="txtUserId" runat="server" MaxLength="10" TabIndex="2"></asp:TextBox>
                <asp:Button ID="bntbrowse" runat="server" Text="..." Width="25px"   
                    OnClick="bntbrowse_Click" CausesValidation="False" TabIndex="3" />
                <asp:Button ID="bntgetdetails" runat="server" Text="Get Details" 
                    OnClick="bntgetdetails_Click" CausesValidation="False" 
                    OnClientClick="javascript:return SelectUser();" TabIndex="4" />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ErrorMessage="User Id is Mandatory" CssClass="formError"
                    ControlToValidate="txtUserId" InitialValue="" 
                    SetFocusOnError="True"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="regUserId" runat="server" 
                    ControlToValidate="txtUserId" CssClass="formError"
                    ErrorMessage="Invalid Userid" ValidationExpression="^[0-9a-zA-Z]+$" 
                    SetFocusOnError="True"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td align="right">
                Role Type<span class="required">*</span>
            </td>
            <td colspan="3">
                <asp:DropDownList ID="ddlUserType" runat="server" AutoPostBack="False" 
                    TabIndex="5" Width="170px" 
                    onselectedindexchanged="onSelectedIndexChanged" >
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="reqUserType" runat="server" 
                    ErrorMessage="User Type is Mandatory" CssClass="formError"
                    ControlToValidate="ddlUserType" InitialValue="0" 
                    SetFocusOnError="True"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="right">
                Remitter Code
            </td>
            <td>
                <input id="txtRemitterId" style="width: 125px" type="text" 
                    runat="server" enableviewstate="false"  readonly="readonly" />
                <asp:Button ID="bntbrowseRemitter" runat="server" Text="..." Width="25px"   OnClick="bntbrowseRemitter_Click" CausesValidation="False" />
            </td>
            <td align="left">
                Customer ID<span class="required">*</span>
            </td>
            <td align="left">
                <asp:TextBox ID="txtCustomerId" runat="server" MaxLength="10" TabIndex="7"></asp:TextBox>
                <asp:RequiredFieldValidator ID="reqCustomerId" runat="server" 
                    ErrorMessage="Customer Id is Mandatory" CssClass="formError"
                    ControlToValidate="txtCustomerId" InitialValue="" 
                    SetFocusOnError="True"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <%--<tr>
            <td align="right">
                Customer ID<span class="required">*</span>
            </td>
            <td colspan="3">
                <asp:TextBox ID="txtCustomerId" runat="server" MaxLength="10"></asp:TextBox>
                <asp:RequiredFieldValidator ID="reqCustomerId" runat="server" 
                    ErrorMessage="Customer Id is Mandatory" CssClass="formError"
                    ControlToValidate="txtCustomerId" InitialValue="" 
                    SetFocusOnError="True"></asp:RequiredFieldValidator>
            </td>
        </tr>--%>
        <tr>
            <td align="right">
                User Name<span style="color: #ff0000">*</span>
            </td>
            <td colspan="3">
                <asp:TextBox ID="txtUserName" runat="server" MaxLength="35" TabIndex="8"></asp:TextBox>
                <asp:RequiredFieldValidator ID="reqUserName" runat="server" 
                    ErrorMessage="User Name is Mandatory" CssClass="formError"
                    ControlToValidate="txtUserName" InitialValue="" 
                    SetFocusOnError="True"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="regUserName" runat="server" 
                    ControlToValidate="txtUserName" CssClass="formError"
                    ErrorMessage="Invalid User Name" 
                    ValidationExpression="^[a-zA-Z0-9''-'\s]{1,50}$" SetFocusOnError="True"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td align="right">
                Password: <span class="required">*</span>
            </td>
            <td colspan="3">
                <asp:TextBox ID="txtPassword" runat="server" TextMode="Password" MaxLength="50" 
                    TabIndex="9"></asp:TextBox>
                <asp:RegularExpressionValidator ID="regPassword" runat="server" 
                    ControlToValidate="txtPassword" CssClass="formError"
                    ErrorMessage="Password must starts with alphabets followed by atleast one digit "
                    SetFocusOnError="True" 
                    ValidationExpression="^([a-zA-Z]+)[0-9]+[a-zA-Z0-9]*"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td align="right">
                Email Id: <span class="required">*</span>
            </td>
            <td>
                <asp:TextBox ID="txtEmail" runat="server" MaxLength="50" TabIndex="10"></asp:TextBox>
                <asp:RequiredFieldValidator ID="reqEmail" runat="server" 
                    ControlToValidate="txtEmail" CssClass="formError"
                    ErrorMessage="Enter Email ID" SetFocusOnError="True"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="regEmail" runat="server" 
                    ControlToValidate="txtEmail" CssClass="formError"
                    ErrorMessage="Enter Correct Email Id Format" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                    SetFocusOnError="True"></asp:RegularExpressionValidator>
            </td>
            <td align="left">
                Mobile No.
            </td>
            <td align="left">
                <asp:TextBox ID="txtMobileNumber" runat="server" MaxLength="15" TabIndex="11"></asp:TextBox>&nbsp;
                <asp:RegularExpressionValidator ID="regMobileNo" runat="server" 
                    ControlToValidate="txtMobileNumber" CssClass="formError"
                    ErrorMessage="Invalid Mobile Number" ValidationExpression="[0-9]*" 
                    SetFocusOnError="True"></asp:RegularExpressionValidator>
            </td>
        </tr>
       <%-- <tr>
            <td align="right">
                Mobile Number
            </td>
            <td colspan="3">
                <asp:TextBox ID="txtMobileNumber" runat="server" MaxLength="15"></asp:TextBox>&nbsp;
                <asp:RegularExpressionValidator ID="regMobileNo" runat="server" 
                    ControlToValidate="txtMobileNumber" CssClass="formError"
                    ErrorMessage="Invalid Mobile Number" ValidationExpression="[0-9]*" 
                    SetFocusOnError="True"></asp:RegularExpressionValidator>
            </td>
        </tr>--%>
        <tr>
            <td align="right">                
            </td>
            <td>
                <asp:CheckBox ID="chkEnable" runat="server" Text="Enable" Checked="True" 
                    TabIndex="12" />&nbsp;
                &nbsp;&nbsp; <asp:CheckBox ID="chkLock" runat="server" Text="Lock" 
                    TabIndex="13" />&nbsp;
                &nbsp;&nbsp; <asp:CheckBox ID="chkActive" runat="server" Text="Active" 
                    Checked="True" TabIndex="14" />
            </td>
        </tr>      
        <tr>
            <td align="right">
            </td>
            <td colspan="3">
                <asp:Button ID="btnSubmit" runat="server" Text="Submit" 
                    OnClick="btnSubmit_Click" TabIndex="15" />
                <asp:Button ID="btnCancel" runat="server" Text="Reset" CausesValidation="False" 
                    OnClick="btnCancel_Click" TabIndex="16" UseSubmitBehavior="False" />
            </td>
        </tr>
    </table>

    <asp:UpdatePanel ID="upUnmatchedLists" runat="server" UpdateMode="Conditional">
        <ContentTemplate>    
                <div id="pnlMatchList" runat="server" class="pnlMatchList">    
                    <span style="azimuth: center;">
                        <div id="Div1" class="formDiv" runat ="server"  >
                            <center>
                                <asp:Label ID="lblMessage" runat="server"    CssClass="lable"/>
                            </center>
                        </div>
                    </span>
                    <div class="formDiv" style="width: 30%;">
                         <center>
                            <asp:Button ID="btnok" runat="server" Text="OK" onclick="btnok_Click" CausesValidation="False"  />
                          </center>
                    </div>
                </div>
            <div style="display: none">
                <asp:Button ID="btnManualPopup" runat="server" />
            </div>
            <ajax:ModalPopupExtender ID="btnClickPopup" runat="server" PopupControlID="pnlMatchList"
                TargetControlID="btnManualPopup" BackgroundCssClass="modalBackground" RepositionMode="RepositionOnWindowScroll" OkControlID = "btnok">
            </ajax:ModalPopupExtender>   
        </ContentTemplate>        
    </asp:UpdatePanel>
    </div>


     <script type="text/javascript">


         function SelectUser() {
             var Username = document.getElementById('<%=txtUserId.ClientID %>').value;
             if (Username == '') {
                 alert("User Id is Mandatory");
                 return false;
             }

             return true;
         }
    </script>
</asp:Content>
